package aybolit.core.objects.model;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import java.io.Serializable;
import java.sql.Timestamp;

/**
 * Created by IntelliJ IDEA.
 * User: Vadim
 * Date: 29.03.13
 * Time: 16:54
 * To change this template use File | Settings | File Templates.
 */
@javax.persistence.Table(name = "healing_diagnosis", schema = "", catalog = "aybolit")
@Entity
public class HealingDiagnosis implements Serializable {
    private int healingDiagnosisId;

    @javax.persistence.Column(name = "healing_diagnosis_id")
    @Id
    public int getHealingDiagnosisId() {
        return healingDiagnosisId;
    }

    public void setHealingDiagnosisId(int healingDiagnosisId) {
        this.healingDiagnosisId = healingDiagnosisId;
    }

    private int healingId;

    @javax.persistence.Column(name = "healing_id")
    @Basic
    public int getHealingId() {
        return healingId;
    }

    public void setHealingId(int healingId) {
        this.healingId = healingId;
    }

    private int diagnosisId;

    @javax.persistence.Column(name = "diagnosis_id")
    @Basic
    public int getDiagnosisId() {
        return diagnosisId;
    }

    public void setDiagnosisId(int diagnosisId) {
        this.diagnosisId = diagnosisId;
    }

    private Timestamp timestamp;

    @javax.persistence.Column(name = "timestamp_")
    @Basic
    public Timestamp getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Timestamp timestamp) {
        this.timestamp = timestamp;
    }

    private int status;

    @javax.persistence.Column(name = "status")
    @Basic
    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        HealingDiagnosis that = (HealingDiagnosis) o;

        if (diagnosisId != that.diagnosisId) return false;
        if (healingDiagnosisId != that.healingDiagnosisId) return false;
        if (healingId != that.healingId) return false;
        if (status != that.status) return false;
        if (timestamp != null ? !timestamp.equals(that.timestamp) : that.timestamp != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = healingDiagnosisId;
        result = 31 * result + healingId;
        result = 31 * result + diagnosisId;
        result = 31 * result + (timestamp != null ? timestamp.hashCode() : 0);
        result = 31 * result + status;
        return result;
    }

    private Diagnosis diagnosisByDiagnosisId;

    @ManyToOne
    public
    @javax.persistence.JoinColumn(name = "diagnosis_id", referencedColumnName = "diagnosi_id")
    Diagnosis getDiagnosisByDiagnosisId() {
        return diagnosisByDiagnosisId;
    }

    public void setDiagnosisByDiagnosisId(Diagnosis diagnosisByDiagnosisId) {
        this.diagnosisByDiagnosisId = diagnosisByDiagnosisId;
    }

    private Healing healingByHealingId;

    @ManyToOne
    public
    @javax.persistence.JoinColumn(name = "healing_id", referencedColumnName = "healing_id")
    Healing getHealingByHealingId() {
        return healingByHealingId;
    }

    public void setHealingByHealingId(Healing healingByHealingId) {
        this.healingByHealingId = healingByHealingId;
    }
}
